package com.ltf.service;

import com.ltf.dao.LargeFileDao;
import com.ltf.entity.LargeFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LargeFileServiceImpl implements LargeFileService{
    @Autowired
    LargeFileDao largeFileDao;
    public LargeFileServiceImpl(){}

    @Override
    public void add(String id, String filename, byte[] content) {
        LargeFile lf = new LargeFile();
        lf.setId(id);
        lf.setFilename(filename);
        lf.setContent(content);
        this.largeFileDao.add(lf);
    }

    @Override
    public LargeFile findOne(String id) {
        return this.largeFileDao.findOne(id);
    }

    @Override
    public void delete(String id) {
        this.largeFileDao.delete(id);
    }
}
